<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>创建考试 - 英语单词测试系统</title>
    <link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.3.0/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-primary">
    <div class="container-fluid">
        <a class="navbar-brand" href="/teacher">英语单词测试系统</a>
        <div class="d-flex">
            <a href="/logout" class="btn btn-outline-light">退出登录</a>
        </div>
    </div>
</nav>
<div class="container mt-5">
    <div class="row justify-content-center">
        <div class="col-md-8">
            <div class="card shadow">
                <div class="card-header bg-primary text-white text-center">
                    <h4>创建新考试</h4>
                </div>
                <div class="card-body">
                    <form method="post">
                        <div class="mb-3">
                            <label class="form-label">考试名称</label>
                            <input type="text" class="form-control" name="name" required>
                        </div>
                        <div class="row mb-3">
                            <div class="col">
                                <label class="form-label">开始时间</label>
                                <input type="datetime-local" class="form-control" name="start_time" required>
                            </div>
                            <div class="col">
                                <label class="form-label">结束时间</label>
                                <input type="datetime-local" class="form-control" name="end_time" required>
                            </div>
                        </div>
                        <div class="mb-3">
                            <label class="form-label">筛选题目</label>
                            <select class="form-select mb-2" name="level_filter" onchange="this.form.submit()">
                                <option value="">全部</option>
                                <option value="CET4" {% if level_filter=='CET4' %}selected{% endif %}>CET4</option>
                                <option value="CET6" {% if level_filter=='CET6' %}selected{% endif %}>CET6</option>
                            </select>
                            <div style="max-height: 250px; overflow-y: auto; border:1px solid #eee; padding:10px;">
                                {% for q in questions %}
                                <div class="form-check">
                                    <input class="form-check-input" type="checkbox" name="question_ids" value="{{ q.id }}" id="q{{ q.id }}">
                                    <label class="form-check-label" for="q{{ q.id }}">
                                        {{ q.word }} - {{ q.meaning }} ({{ q.level }})
                                    </label>
                                </div>
                                {% endfor %}
                            </div>
                        </div>
                        <button type="submit" class="btn btn-primary w-100">创建考试</button>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html> 